package packageModel;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;

/**
 *
 * @author Lionel & Julien
 */
public class Promotion implements Serializable {
    
    /*
     * PROMOTION : 
     */
    
    /*
     * VARIABLE
     */
    
    private int codeId;
    private double reduction;
    private GregorianCalendar dateDebut;
    private GregorianCalendar dateFin;
    
    /*
     * CONSTRUCTEUR
     */

    /**
     * 
     * @param codeId
     * @param reduction
     * @param dateDebut
     * @param dateFin
     */
    public Promotion(int codeId, double reduction, GregorianCalendar dateDebut, GregorianCalendar dateFin) {
        this.codeId = codeId;
        this.reduction = reduction;
        this.dateDebut = dateDebut;
        this.dateFin = dateFin;
    }
    
    /*
     * GET
     */
    
    /**
     * 
     * @return codeId
     */
    public int getCodeId() { return codeId; }
    /**
     * 
     * @return reduction
     */
    public double getReduction() { return reduction; }
    /**
     * 
     * @return dateDebut
     */
    public GregorianCalendar getDateDebut() { return dateDebut; }
    /**
     * 
     * @return dateFin
     */
    public GregorianCalendar getDateFin() { return dateFin; }
    
    /**
     * 
     * @return
     */
    public String getDateFinString() { 
        GregorianCalendar dateGreg = new GregorianCalendar();
 
        DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
        java.util.Date dateDate = dateGreg.getTime();
        return dateFormat.format(dateDate); 
    }
    
    /*
     * SET
     */
    /**
     * 
     * @param codeId
     */
    public void setCodeId(int codeId) { this.codeId = codeId; }
    /**
     * 
     * @param reduction
     */
    public void setReduction(double reduction) { this.reduction = reduction; }
    /**
     * 
     * @param dateDebut
     */
    public void setDateDebut(GregorianCalendar dateDebut) { this.dateDebut = dateDebut; }
    /**
     * 
     * @param dateFin
     */
    public void setDateFin(GregorianCalendar dateFin) { this.dateFin = dateFin; }
    
    
}
